<template>
	<view class="nav-bar-white">
		<view :style="{height:statusBarHeight+'px'}"></view>
		<uni-nav-bar left-icon="left" background-color="#FFF" color="#000" @clickLeft="back" title="规格设置" :border="false" fixed="true"></uni-nav-bar>
	</view>
	<view :style="{marginTop:statusBarHeight+45+'px'}">
		<view style="margin-left: 30rpx;padding-top: 20rpx;">
			<text>设置规格项</text>
		</view>
		
		<view class="item-spec" v-for="(item,index) in sepcList" :key="index">
			<view class="flex-row items-center">
			
				<view class="flex-row justify-between items-center" style="width: 30%;">
					<image src="/static/goods/red_delete.png" style="width: 35rpx;height: 35rpx;"></image>
					<text>规格项{{index+1}}</text>
				</view>
				<view style="width: 70%;padding-left: 80rpx;">
					<text>颜色</text>
				</view>
				
			</view>
			<view class="line" style="margin-top: 30rpx;margin-bottom: 30rpx;"></view>
			<view class="flex-row items-center">
				<view class="flex-row justify-end" style="width: 30%;">
					<text>规格值</text>
				</view>
				<view style="width: 70%;padding-left: 80rpx;">
					<text>黑色/白色</text>
				</view>
			</view>
			<view class="line" style="margin-top: 30rpx;margin-bottom: 30rpx;"></view>
			<view class="flex-row items-center">
				<view class="flex-row justify-end" style="width: 30%;">
					<text>规格明细</text>
				</view>
				<view class="sku-set" @click="goSkuDetail">
					<text style="color: #3274F9;">去设置</text>
					<uni-icons type="right" size="18"></uni-icons>
				</view>
			</view>
		</view>
		
		<view class="flex-row justify-center" style="margin-top: 50rpx;color: #3274F9;">
			<text @click="addSpec">+ 添加规格项</text>
		</view>
		
		
		
	</view>
</template>

<script>
	import { useUserStore } from '../../store/userStore';
	export default {
		data() {
			return {
				sepcList:[{},{}]
			};
		},
		computed:{
			statusBarHeight(){
				return useUserStore().statusBarHeight
			}
		},
		methods:{
			goSkuDetail(){
				uni.navigateTo({
					url: '/pages/add_goods/sku_detail'
				})
			},
			addSpec(){
				uni.navigateTo({
					url: '/pages/add_goods/add_spec'
				})
			},
			back(){
				uni.navigateBack()
			}
		}
	}
</script>

<style lang="scss">
.item-spec{
	background-color: #fff;
	border-radius: 10rpx;
	margin: 15rpx;
	padding: 30rpx;
	display: flex;
	flex-direction: column;
}
.sku-bg{
	background-color: #fff;
	padding: 30rpx;
	margin: 15rpx;
	border-radius: 10rpx;
}
.sku-set{
	display: flex;
	flex-direction: row;
	justify-content: flex-end;
	width: 80%;
}
</style>
